package cn.wjzhang.core.enums;

/**
 * ========================
 * 功能描述
 *
 * @author wjzhang
 * @version v1.0
 * ========================
 * @date 2023/7/5 12:34
 */
public enum ErrorCodeEnum {
    /**
     * 异常代码
     */
    INVALID_REQUEST_PARAMETER("1001", "请求参数无效"),
    AUTHENTICATION_FAILURE("1002", "认证失败"),
    DATA_NOT_FOUND("1003", "数据不存在"),
    INSUFFICIENT_PERMISSIONS("1004", "无权限访问"),
    DATABASE_CONNECTION_FAILURE("1005", "数据库连接失败"),
    FILE_READ_ERROR("2001", "文件读取错误"),
    FILE_WRITE_ERROR("2002", "文件写入错误"),
    INVALID_FILE_FORMAT("2003", "文件格式无效"),
    NETWORK_TIMEOUT("3001", "网络连接超时"),
    SERVICE_UNAVAILABLE("3002", "服务不可用"),
    DATA_PARSING_ERROR("4001", "数据解析错误"),
    DATA_CONVERSION_ERROR("4002", "数据转换错误"),
    CONCURRENT_ACCESS_CONFLICT("5001", "并发访问冲突"),
    DATA_VALIDATION_FAILURE("5002", "数据验证失败"),
    UNKNOWN_ERROR("9001", "未知错误");

    private final String code;
    private final String message;

    ErrorCodeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}

